var userVipCardRent = {
	userVipCardRentId: '',
	userVipCardId: '',
	rentMonthNum: '',
	rentAmount: '',
	renterName: '',
	renterSex: '',
	renterCardId: '',
	renterAddress: '',
	renterPhoneNumber: '',
	renterEmail: '',
	createTime: '',
	updateTime: '',
	createId: getLoginedUser()? getLoginedUser().staffId: '',
	updateId: getLoginedUser()? getLoginedUser().staffId: '',
	remark: '',
	vipCardName: '',
};

var view = {
	data: userVipCardRent
};

var vue_vm = new Vue({
	el: '#vue_vm',
	data: view
});

function save() {
	if(view.data.userVipCardId=='') {
		alert('请查找并选择VIP卡');
		return;
	}
	if(view.data.rentMonthNum=='') {
		alert('请输入出租时长');
		return;
	}
	if(view.data.rentAmount=='') {
		alert('请输入出租金额');
		return;
	}
	if(view.data.renterName=='') {
		alert('请输入承租者姓名');
		return;
	}
	if(view.data.renterCardId=='') {
		alert('请输入承租者身份证号');
		return;
	}
	if(view.data.renterPhoneNumber=='') {
		alert('请输入承租者手机');
		return;
	}
	
	view.data.renterSex = (view.data.renterSex==''? 0: parseInt(view.data.renterSex));

	save_basic(path+'/userVipCardRent/save', {userVipCardRent:view.data}, function() {
		alert('VIP卡出租成功');
		window.open('3-1-4viprent-print.html?userVipCardId='+view.data.userVipCardId);
	});
}

function deleteBatch() {
	deleteBatch_basic(path+'/userVipCardRent/deleteBatch');
}
